package GUI;
import java.awt.Component;
import java.util.Vector;

import javax.swing.JFrame;


public abstract class AbstractMenu 
{
	protected Vector<Component> items;
	private JFrame frame;
	
	public JFrame getFrame()
	{
		return frame;
	}
	
	public AbstractMenu(JFrame frame)
	{
		this.frame = frame;
		items = new Vector<Component>();
	}
	public void destroy()
	{
		for(Component c : items) 
		{
			c.setVisible(false);
			frame.getContentPane().remove(c);
			frame.remove(c);
		}
		items.clear();
	}
	public void regItem(Component c)
	{
		items.add(c);
		frame.getContentPane().add(c);
		c.setVisible(true);
	}
	
	public abstract void connectionInterrupted();
	public abstract void incomingMessage(String msg);
	public abstract void create();
		
}
